﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Text;

public partial class Arabic_buss_opp_details : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        this.gvDetails.DataSource = FillgvDetails();

        this.gvDetails.DataBind();

        this.gvResult.DataSource = FillgvResult();

        if (FillgvDetails().Rows.Count == 0)

            return;

        else

            this.gvResult.DataBind();


    }

    private DataTable FillgvDetails()
    {

        var connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
        var qs = Request.QueryString["ID"];
        var adapter = new SqlDataAdapter("Select DetailsAr,KindAr,GovernorateAr,SourceAr,LocalOrIntAr From BusOprtuDetails BD Where BD.ID =" + qs, connectionString);
        //-------------------------------------------------------------------------------------------------
        DataTable dt = new DataTable();
        adapter.Fill(dt);
        return dt;

    }

    private DataTable FillgvResult()
    {
        var connectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
        var qs = Request.QueryString["ID"];
        var adapter = new SqlDataAdapter("Select * From BusinessOportunities BO Where BO.ID =" + qs, connectionString);
        //-------------------------------------------------------------------------------------------------
        DataTable dt = new DataTable();
        adapter.Fill(dt);
        return dt;

    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Arabic_buss_opp.aspx");
    }
    protected void gvDetails_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
